﻿using UnityEngine;

namespace Snake.Gameplay
{
    public sealed class GameplayCueSpec
    {
        private readonly GameplayCue _cue;
        private GameplayCueComponent _cueComponent;
        public GameplayCueContainer Container { get; set; }

        public GameplayAbilityComponent Owner => Container.Owner;

        public GameplayCueSpec(GameplayCue cue)
        {
            _cue = cue;
        }

        public void OnEnable()
        {
            _cueComponent = Object.Instantiate(_cue.asset);
            _cueComponent.Spec = this;
        }

        public void OnUpdate(float dt)
        {
        }

        public void OnDisable()
        {
            Object.Destroy(_cueComponent.gameObject);
        }
    }
}